const { baseModel } = require('./baseModel')
const mongoose = require('mongoose')

const orderSchema = new mongoose.Schema({
    //用户id
    userId:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'User',
        required:true
    },
    //就诊人id
    patientId:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'Patient',
        required:true
    },
    //医生id
    doctorId:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'Hospital',
        required:true
    },
    //排班Id
    scheduleId:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'DocScheduling',
        required:true
    },
    //挂号状态
    registerStatus:{
        type:Number,
        enum:[0,1,2], // 0 待支付 1 已支付 2 已取消
        default:0
    },
    ...baseModel
})

module.exports = orderSchema